var mongoose = require('./db.js')

var NewsSchema = mongoose.Schema({
  title: { 
    type: String, 
    trim: true  // 定义 mongoose修饰符 去掉空格
  }, 
  author: String,
  pic: String,
  content: String,
  status: {
    type: Number,
    default: 1 // 默认参数
  }
})

var NewsModel = mongoose.model('News', NewsSchema, 'news')

module.exports = NewsModel